package io;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * 练习：向文件中写入字符数据
 * */
public class Test1 {
    public static void main(String[] args) throws IOException {
        /*
        FileOutputStream fos = new FileOutputStream("fos.txt");
        for (char c='a';c<='z';c++){
            fos.write(c);
        }
        System.out.println("写出完毕");
        fos.close();

         */

        FileInputStream fis = new FileInputStream("fos.txt");
        int d;
        while ((d=fis.read())!=-1){
            System.out.println((char)d);
        }
        fis.close();



    }
}
